package org.anupta.game.utils.others;

public class EnumsInfo {
	public static enum Type {

        CLASSIC((byte)0),
        HARDCORE((byte)1);

        private final byte type;

        private Type(byte type) {
            this.type = type;
        }

        public byte getType() {
            return type;
        }

        public static Type get(byte type) {
            if (type == 1) {
                return HARDCORE;
            }
            return CLASSIC;
        }

    }

    public static enum State {

        OFFLINE((byte)0),
        ONLINE((byte)1),
        SAVING((byte)2);

        private final byte state;

        private State(byte state) {
            this.state = state;
        }

        public byte getState() {
            return this.state;
        }

        public static State get(int state) {
            if(state == 1) {
                return ONLINE;
            } else if(state == 2) {
                return SAVING;
            } else {
                return OFFLINE;
            }
        }

    }

    public static enum Population {

        RECOMMENDED((byte)0),
        AVERAGE((byte)1),
        HIGH((byte)2),
        LOW((byte)3),
        FULL((byte)4);

        private final byte population;

        private Population(byte population) {
            this.population = population;
        }

        public static Population get(int population) {
            if (population == 1) {
                return AVERAGE;
            } else if (population == 2) {
                return HIGH;
            } else if (population == 3) {
                return LOW;
            } else if (population == 4) {
                return FULL;
            }
            return RECOMMENDED;
        }

        public byte getPopulation() {
            return population;
        }
    }

    public static enum Community {

        FRANCOPHONE((byte)0),
        BRITISH((byte)1),
        INTERNATIONALE((byte)2),
        GERMAN((byte)3),
        SPANISH((byte)4),
        RUSSIAN((byte)5),
        BRAZILIAN((byte)6),
        NEERLANDAISE((byte)7),
        ITALIAN((byte)8),
        JAPANESE((byte)10),
        DEBUG((byte)99);

        private final byte community;

        private Community(byte community) {
            this.community = community;
        }

        public static Community get(byte community) {
            if (community == 0) {
                return FRANCOPHONE;
            } else if (community == 1) {
                return BRITISH;
            } else if (community == 3) {
                return GERMAN;
            } else if (community == 4) {
                return SPANISH;
            } else if (community == 5) {
                return RUSSIAN;
            } else if (community == 6) {
                return BRAZILIAN;
            } else if (community == 7) {
                return NEERLANDAISE;
            } else if (community == 8) {
                return ITALIAN;
            } else if (community == 10) {
                return JAPANESE;
            } else if (community == 99) {
                return DEBUG;
            }
            return INTERNATIONALE;
        }

        public byte getCommunity() {
            return community;
        }
    }
}
